package bm.com.project.server.organization.mapper;

import bm.com.project.server.common.dto.BmSysChangeOrgListDTO;
import bm.com.project.server.common.dto.SearchBaseDTO;
import bm.com.project.server.organization.dto.VoBmOrgMemberDTO;
import bm.com.project.server.organization.entity.BmOrgMemberEntity;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BmOrgMemberMapper extends BaseMapper<BmOrgMemberEntity> {

    IPage<List> selectPage(Page<Object> page, @Param("queryParam") QueryWrapper<Object> queryWrapper);

    /**
     * 获取组织列表
     * @param userId
     * @return
     */
    List getOrgListByUserId (String userId);

    /**
     * 通过搜索条件，获取列表
     * @param queue
     * @return
     */
    List<VoBmOrgMemberDTO> getOrgMembersBySearch (SearchBaseDTO queue);

    /**
     * 计算总数
     * @param queue
     * @return
     */
    Integer getOrgMembersBySearchCount (SearchBaseDTO queue);

    /**
     * 获取组织列表
     * @param userId
     * @return
     */
    List<BmSysChangeOrgListDTO> getOrgListByUserIdCommon (String userId);

    /**
     * 获取组织中成员信息
     * @param orgId
     * @param userId
     * @return
     */
    BmOrgMemberEntity getOrgUser (String orgId,String userId);


    Integer selectCount(QueryWrapper<Object> queryWrapper);


}
